﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" class="loading">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
	<meta name="viewport" content="width=device-width, initial-scale=0.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
	<meta name="keywords" content="新创社" />
	<meta name="description" content="新创社会创新">
	<meta name="author" content="新创社" />
	<meta content="yes" name="apple-mobile-web-app-capable">
	<meta content="black" name="apple-mobile-web-app-status-bar-style">
	<meta content="telephone=no" name="format-detection">
	<title>新创社会创新</title>
	<link rel="stylesheet" type="text/css" href="../css/indexstyle.css" />
    <link rel="stylesheet" type="text/css" href="css/account.css" />
	<link rel="apple-touch-icon-precomposed" href="../img/default/defaultshare.jpg">
	<link href="../img/icons/favicon.ico" rel="shortcut icon" type="image/x-icon">
</head>
<body>
		 <?php
		 		session_start();
				$user = array('注册会员','技术','设计','产品','打杂','运营','投资人');
				$usersex= array('男','女');
				require_once("../connectMysql/connetMysql.class.php");
					
				$userid=$_GET['userid']; 
					
				$db=new connetMysql;
				$con=$db->getConnect();
				
		?>
		<div class="head">
			<!-- Header -->
			<div id="header">
				<a id="menu" href="#menu"></a>
				<span id="Logo" class="svg">
					<img src="../img/icons/logo.png" />
				</span>
                <?php if(empty($_GET['userid']))
					  {
						  	
							if(empty($_SESSION['mb'])) 
							{
								$db->clossConnet();
								echo "<script>window.location.href='../login/login.html'</script>";
							}
							else
							{
								echo "<a class=\"backBtn\" href=\"updateme.php\">编辑</a>";
								$getuserid_sql="SELECT UserId FROM user WHERE UserPhone=".$_SESSION['mb'];
								$result2=mysqli_query($con,$getuserid_sql);
								$row2 = mysqli_fetch_assoc($result2);
								$userid=$row2['UserId'];
							}
					  }
					  else
					  {
							if(empty($_SESSION['mb']))  
								echo "<a class=\"backBtn\" onclick=\"javascript:history.go(-1);\">返回</a>";
							else
							{
								$chkmb_sql="SELECT UserId FROM user WHERE userid=".$userid." AND UserPhone=".$_SESSION['mb'];
								mysqli_query($con,$chkmb_sql);
								$num=mysqli_affected_rows($con);
								if($num==0)
								{
									echo "<a class=\"backBtn\" onclick=\"javascript:history.go(-1);\">返回</a>";
								}
								else
								{
									echo "<a class=\"backBtn\" href=\"updateme.php\">编辑</a>";
								}
							}
					  }
					  
					  
					  $chk_sql="SELECT UserImg,PetName,IfOpenName,UserName,UserBirth,UserTypeId,UserDescri,UserSex,UserPhone,IfOpenPhone,RegisterTime,HomeProv,HomeCity,LivProv,LivCity,Skill,OpenContact,WorkExper,EduExper FROM user WHERE UserId=".$userid;	
				$result=$con->query($chk_sql);
				$row = mysqli_fetch_assoc($result);
				?>
				
			</div>
            <!--End Header-->
			<div class="subHeader"><i class="i-home i-small"></i>个人中心</div>
			
		</div>
        <div class="main"  id="wrapper">  
             <a class="profile menuitem" role="menuitem">
               
                <div>
                    <div class="avatar">
                        <img src="../<?php echo $row['UserImg']; ?>" width="50" height="50" alt="头像">
                    </div>
                    <em class="name"><?php 
					
										if($row['IfOpenName'])
										 {
											 if(empty($row['PetName']))
											 	echo $row['PetName'];
											 else
												echo '未填写';
										 }
										 else
										 {
											 echo $row['UserName'];
											 if(!empty($row['PetName']))
											 	echo '/'.$row['PetName'];
										 }
									?>
                   </em>
                    <span class="rank"><?php 
											if(!empty($row['UserBirth']))
												echo $row["UserBirth"]."  ";
												
											if(!empty($row['UserTypeId']))
												echo $user[$row['UserTypeId']];
											if(!empty($row['UserSex']))
												echo $usersex[$row['UserSex']-1];
											  
										?>
                    </span>
                </div>
                
            </a> 
            
            <div class="account-menu menu" role="menu">
                <a role="menuitem" class="menuitem" >
                 	<em class="comment">个人描述</em>
                    <i > 
						<?php if(empty($row['UserDescri']))
									echo "未填写";
								else
									echo $row['UserDescri'];
						 ?>
											
                    </i>
                </a>
                <a role="menuitem" class="menuitem" >
                    <em class="post">所在地区</em>
                    <i >
                    	<?php if(empty($row['LivProv']))
									echo "未填写";
								else
									echo $row['LivProv'].$row['LivCity'];
						 ?>
                    </i>
                </a>
                <a role="menuitem" class="menuitem" >
                	<em class="fav">家乡地区</em>
                    <i>
                    	<?php if(empty($row['HomeProv']))
									echo "未填写";
								else
									echo $row['HomeProv'].$row['HomeCity'];
						 ?>
                    </i>
                </a>
                <a role="menuitem" class="menuitem" >
                    <em class="ershou">联系方式</em>
                     <i>
                     	<?php if(empty($row['IfOpenPhone']))
								{
									if(empty($row['OpenContact']))
										echo "未填写";
									else
										echo $row['OpenContact'];
								}
							  else
							  {
								  echo "手机：".$row['UserPhone'];
								  if(!empty($row['OpenContact']))
										echo "/".$row['OpenContact'];
							  }
									
						 ?>
                     </i>
                </a>
               
                <a role="menuitem" class="menuitem">
                   
                    <em class="tuan">教育经历</em>
                    <i>
                    	<?php if(empty($row['EduExper']))
									echo "未填写";
								else
									echo $row['EduExper'];
						 ?>
                    </i>
                </a>
                <a role="menuitem" class="menuitem">
                  
                    <em class="weidian">擅长领域</em>  
                    <i>
                    	<?php if(empty($row['Skill']))
									echo "未填写";
								else
									echo $row['Skill'];
						 ?>
                    </i>
                </a>
                <a role="menuitem" class="menuitem">
                  
                    <em class="weidian">注册时间</em>  
                    <i>
                    	<?php 
							echo date("Y-m-d",strtotime($row["RegisterTime"]));
						 ?>
                    </i>
                </a>
                 <a role="menuitem" class="menuitem">
                    <em class="ask">工作经历</em>
                    <i>
                    	<?php if(empty($row['WorkExper']))
									echo "未填写";
								else
									echo str_replace("\r\n",'<br/>',$row["WorkExper"]);
									
						 ?>
                    </i>
                </a>
            </div>
     
        </div>

		<div class="foot">
    		<!-- Footer -->
            <section class="footer">
                <ul>
                    <li><a href="../people/person.php"><img src="../img/icons/blog.png" width="18" height="26" alt="icon"><span>人</span></a></li>
                    <li><a href="../index.php"><img src="../img/icons/contact.png" width="27" height="26" alt="icon"/><span>约</span></a></li>
                   
                   	<li><a href="me.php"><img src="../img/icons/about.png" width="25" height="26" alt="icon"/><span>我</span></a></li>
                 
                </ul>
            </section>

			<!--End Footer -->
    	</div>

</body>

</html>